﻿<?xml version="1.0" encoding="utf-8" ?>
<CodeSnippets  xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
    <CodeSnippet Format="1.0.0">
        <Header>
            <Title>Define a Readonly DependencyProperty</Title>
            <Shortcut>propdpr</Shortcut>
            <Description>Code snippet for a property using Readonly DependencyProperty as the backing store</Description>
            <Author>Microsoft Corporation</Author>
            <SnippetTypes>
                <SnippetType>Expansion</SnippetType>
            </SnippetTypes>
        </Header>
        <Snippet>
            <Declarations>
                <Literal>
                    <ID>type</ID>
                    <ToolTip>Property Type</ToolTip>
                    <Default>int</Default>
                </Literal>
                <Literal>
                    <ID>property</ID>
                    <ToolTip>Property Name</ToolTip>
                    <Default>MyProperty</Default>
                </Literal>
                <Literal>
                    <ID>ownerclass</ID>
                    <ToolTip>The owning class of this Property.  Typically the class that it is declared in.</ToolTip>
					<Function>ClassName()</Function>
					<Default>ClassNamePlaceholder</Default>
                </Literal> 
            </Declarations>
            <Code Language="csharp">
                <![CDATA[public $type$ $property$
{
    get { return ($type$)GetValue($property$Property); }
    private set { SetValue($property$PropertyKey, value); }
}
 private static DependencyPropertyKey $property$PropertyKey = DependencyProperty.RegisterReadOnly("$property$", typeof($type$), typeof($ownerclass$), new PropertyMetadata(default($type$)));
 public static DependencyProperty $property$Property = $property$PropertyKey.DependencyProperty;  
$end$]]>
            </Code>
        </Snippet>
    </CodeSnippet>
</CodeSnippets>
